﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
using MenesDroid;
using Microsoft.Xna.Framework.Content;
using XNA_Game_Engine.Canvas.Level_Selection;

namespace XNA_Game_Engine.Canvas
{

   public class LevelSelectionCanvas : Canvas
    {
       LevelSlotsFrame levelSlots;

       public LevelSelectionCanvas(Game game)
        {
            Width = game.Window.ClientBounds.Width;
            Height = game.Window.ClientBounds.Height;

            Buttons = new Botoes();
            Rand = new Random();

            levelSlots = new LevelSlotsFrame(game, 100, 100 , Width - 200, Height - 200);

        }


        public override void LoadContent(ContentManager content)
        {
            Buttons.Add(new clsButton(content.Load<Texture2D>(@"Buttons\main_menu_button"),
                                     content.Load<Texture2D>(@"Buttons\main_menu_button"), 
                                     new Vector2(Width - 300, Height - 90), new Vector2(255, 75),
                                     ActionsHandler.MainMenuButtonEvent));



            Background = content.Load<Texture2D>(@"Level_Selection_Screen\level_select_back");

            levelSlots.LoadContent(content);
        }


        public override void Update(GameTime gameTime)
        {
            levelSlots.Update(gameTime);
            Buttons.Update();
        }


        public override void Render(SpriteBatch renderTarget)
        {
            renderTarget.Draw(Background, new Rectangle(0, 0, Width, Height), Color.White );

            levelSlots.Render(renderTarget);
            Buttons.Draw(renderTarget); 				

        }


    } // class
} // namespace
